package com.atos.optical.model.po;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author wanghra
 * @version 1.0
 * @description 菜单信息表
 * @date 2025/8/13
 */
@Data
@Entity
@Table
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class SysMenuInfo implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @Column(name = "MENU_ID", length = 50, nullable = false)
    @TableId(value = "MENU_ID", type = IdType.ASSIGN_UUID)
    private String menuId;
    /**
     * 菜单名称
     */
    @Column(name = "MENU_NAME", length = 200, nullable = false)
    @TableField(value = "MENU_NAME")
    private String menuName;
    /**
     * 路由名称
     */
    @Column(name = "MENU_ROUTE_NAME", length = 200, nullable = false)
    @TableField(value = "MENU_ROUTE_NAME")
    private String menuRouteName;
    /**
     * 菜单Icon图标
     */
    @Column(name = "MENU_ICON", length = 50, nullable = false)
    @TableField(value = "MENU_ICON")
    private String menuIcon;
    /**
     * 菜单地址
     */
    @Column(name = "MENU_URL", length = 500, nullable = false)
    @TableField(value = "MENU_URL")
    private String menuUrl;
    /**
     * 排序
     */
    @Column(name = "MENU_SORT", nullable = false)
    @TableField(value = "MENU_SORT")
    private Integer menuSort;
    /**
     * 父级ID
     */
    @Column(name = "PARENT_ID", length = 50, nullable = false)
    @TableField(value = "PARENT_ID")
    private String parentId;
    /**
     * 创建日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "CREATE_TIME")
    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT, insertStrategy = FieldStrategy.NOT_NULL)
    private LocalDateTime createTime;
    /**
     * 修改日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "MODIFY_TIME")
    @TableField(value = "MODIFY_TIME", fill = FieldFill.UPDATE)
    private LocalDateTime modifyTime;
}
